home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / comm / misc / pbill33b.lha / Phonebill / Install Phonebill next >
Text File  |  1995-06-17  |  10KB  |  345 lines

  1. ;** Yo Emacs, this looks like a -*- lisp -*- file
  2. ;**
  3. ;** $VER: Install-Phonebill 3.3b (17.06.95)
  4. ;**
  5. ;** Install script for phonebill
  6. ;**
  7. ;** Copyright © 1994 Raymond Penners
  8. ;** All rights reserved
  9. ;**
  10.  
  11. (if (< (/ (getversion) 65536) 37)
  12.         (abort wrongkickstart)
  13. )
  14.  
  15.  
  16.  
  17. ;**
  18. ;**  Ask user where to place `phonebill' and setup dir/file vars accordingly
  19. ;**
  20.  
  21. (complete 0)
  22.  
  23. (set pbilldest
  24.     (askdir
  25.         (prompt "Select where to install `phonebill'\nA directory "Phonebill" will be created automatically")
  26.         (help @askdir-help)
  27.         (default @default-dest)
  28.     )
  29. )
  30. (set pbilldir             (tackon pbilldest "Phonebill"))
  31. (set @default-dest        pbilldir)
  32. (set docdir               (tackon pbilldir "Documentation"))
  33. (set configdir            (tackon pbilldir "Config"))
  34. (set ratesfile            (tackon configdir "Rates.config"))
  35. (set catalogdir           (tackon pbilldir "Catalogs"))
  36. (set oldvernum 0)
  37.  
  38.  
  39. ;**
  40. ;**  Create directory/Check if there is already a copy installed
  41. ;**
  42.  
  43. (complete 10)
  44.  
  45. (set extype (exists pbilldir))
  46. (if (= extype 1) (abort "There already exists a file named \"phonebill\""))
  47. (if (= extype 2)
  48.     (
  49.         (if (exists (tackon pbilldir "phonebill"))
  50.             (
  51.                 (set oldvernum (getversion (tackon pbilldir "Phonebill")))
  52.                 (message
  53.                     (cat "A copy of `phonebill' already exists. "
  54.                          "If you proceed, this copy will be updated. Certain files "
  55.                          "will be overwritten."
  56.                     )
  57.                 )
  58.             )
  59.         )
  60.     )
  61.     (makedir pbilldir (infos))
  62. )
  63. (makedir docdir (infos))
  64. (makedir configdir (infos))
  65. (makedir catalogdir)
  66.  
  67. (set oldver (/ oldvernum 65536))
  68. (set oldrev (- oldvernum (* oldver 65536) ) )
  69.  
  70.  
  71.  
  72. ;**
  73. ;**  Install executable and library
  74. ;**
  75.  
  76. (complete 20)
  77.  
  78. (copylib
  79.     (help @copylib-help)
  80.     (prompt "Installing gtlayout.library\nCopyright © 1990-1994 Olaf Barthel")
  81.     (confirm)
  82.     (source "Libs/gtlayout.library")
  83.     (dest "LIBS:")
  84. )
  85.  
  86. (complete 30)
  87.  
  88. (copyfiles
  89.     (help @copyfiles-help)
  90.     (source "Phonebill")
  91.     (dest pbilldir)
  92.     (prompt "Installing the executable program")
  93.     (confirm)
  94.     (infos)
  95. )
  96.  
  97.  
  98. ;**
  99. ;**  Install documentation
  100. ;**
  101.  
  102. (complete 40)
  103.  
  104. (set docchoice
  105.     (askoptions
  106.         (prompt "There are three formats available for the documentation.")
  107.         (choices "AmigaGuide Format (required for online help)" 
  108.                  "TeX DVI Format (for printed manuals)"
  109.                  "Plain ASCII Format")
  110.         (help @askoptions-help)
  111.     )
  112. )
  113. (if (<> 0 (BITAND docchoice 1))
  114.     (
  115.         (copyfiles
  116.             (prompt "Installing AmigaGuide manual...")
  117.             (source "Documentation/Phonebill.guide")
  118.             (dest docdir)
  119.             (help @copyfiles-help)
  120.             (infos)
  121.         )
  122.     )
  123. )
  124.  
  125. (complete 50)
  126.  
  127. (if (<> 0 (BITAND docchoice 2))
  128.     (
  129.         (copyfiles
  130.                 (prompt "Installing DVI manual...")
  131.                 (source "Documentation/Phonebill.DVI")
  132.                 (dest docdir)
  133.                 (help @copyfiles-help)
  134.                 (infos)
  135.         )
  136.     )
  137. )
  138.  
  139. (complete 60)
  140.  
  141. (if (<> 0 (BITAND docchoice 4))
  142.     (
  143.         (copyfiles
  144.                 (prompt "Installing ASCII manual...")
  145.                 (source "Documentation/Phonebill.doc")
  146.                 (dest docdir)
  147.                 (help @copyfiles-help)
  148.                 (infos)
  149.         )
  150.     )
  151. )
  152.  
  153. (complete 65)
  154. (copyfiles
  155.         (prompt "Installing registration forms...")
  156.         (source "Documentation")
  157.         (dest docdir)
  158.         (pattern "Register#?")
  159.         (infos)
  160.         (help @copyfiles-help)
  161. )
  162. (complete 70)
  163.  
  164.  
  165. ;**
  166. ;**  Configuration files
  167. ;**
  168.  
  169. (complete 80)
  170.  
  171. (set installedcfg 0)
  172.  
  173. (if (exists "envarc:phonebill/phonebill.prefs")
  174.     (
  175.         (if (= 1    (askbool(prompt (cat "Old (pre 3.0) `phonebill' configuration files have been found in \"ENV:\" and \"ENVARC:\". "
  176.                                          "Starting from release 3.0, the configuration files "
  177.                                          "have changed from IFF format to plain ASCII text files. "
  178.                                          "Do you want to update these configuration files for use "
  179.                                          "with this release, or do you want to use "
  180.                                          "the default configuration files ?"
  181.                                     )
  182.                              )
  183.                             (help @askbool-help)
  184.                             (choices "Update configuration" "Default configuration")
  185.                     )
  186.             )
  187.  
  188.             (
  189.                 (working "Updating configuration")
  190.                 (run "Extras/UpdateConfig2.x")
  191.                 (copyfiles
  192.                     (help @copyfiles-help)
  193.                     (prompt "Installing the updated configuration files")
  194.                     (source "T:")
  195.                     (dest configdir)
  196.                     (pattern "#?.config")
  197.                     (confirm)
  198.                 )
  199.                 (set installedcfg 1)
  200.             )
  201.         )
  202.         (if (= 1 (askbool (prompt "The files in \"ENV:\" and \"ENVARC:\" are no longer needed. Do you want to remove them?")
  203.                           (help @askbool-help)
  204.                  )
  205.             )
  206.             (
  207.                 (working "Removing `phonebill' related files from \"ENV:\" and \"ENVARC:\"")
  208.                 (run "delete env:phonebill all")
  209.                 (run "delete envarc:phonebill all")
  210.             )
  211.         )
  212.     )
  213. )
  214.  
  215. (complete 90)
  216.  
  217. (if (= installedcfg 0)
  218.     (if (and (= oldver 3) (= oldrev 0))
  219.         (
  220.             (message "The configuration needs to be updated for use with this release of `phonebill'.")
  221.             (working "Updating configuration")
  222.             (run ("Extras/UpdateConfig3.0 \"%s\"" configdir))
  223.             (copyfiles
  224.                 (help @copyfiles-help)
  225.                 (prompt "Installing the updated configuration files")
  226.                 (source "T:")
  227.                 (dest configdir)
  228.                 (pattern "#?.config")
  229.                 (confirm)
  230.             )
  231.         )
  232.         (
  233.             (if (= 0 (exists (tackon configdir "Host.config")))
  234.                 (copyfiles (source "Config/Host.config") (dest configdir))
  235.             )
  236.             (if (= 0 (exists (tackon configdir "Misc.config")))
  237.                 (copyfiles (source "Config/Misc.config") (dest configdir))
  238.             )
  239.             (if (= 0 (exists (tackon configdir "Logs.config")))
  240.                 (copyfiles (source "Config/Logs.config") (dest configdir))
  241.             )
  242.             (if (= 0 (exists (tackon configdir "Presets.config")))
  243.                 (copyfiles (source "Config/Presets.config") (dest configdir))
  244.             )
  245.  
  246.             (set updaterates 1)
  247.  
  248.             (if (= 1 (exists ratesfile))
  249.                 (set updaterates
  250.                     (askbool
  251.                         (prompt "A \"Rates.config\" file already exists. If you didn't modify "
  252.                                 "these rates yourself, you might want to update the rates "
  253.                                 "with the one supplied with this version."
  254.                         )
  255.                         (choices "Install new rates" "Do not modify rates")
  256.                         (help @askbool-help)
  257.                     )
  258.                 )
  259.             )
  260.  
  261.             (if (= 1 updaterates)
  262.                 (
  263.                     (set ratechoice
  264.                         (askoptions
  265.                             (prompt "Select the countries whose rates you wish to install:")
  266.                             (choices "Belgium"
  267.                                      "Deutschland"
  268.                                      "France"
  269.                                      "Italy"
  270.                                      "Nederland"
  271.                                      "Norge"
  272.                                      "Sverige"
  273.                             )
  274.                             (help @askoptions-help)
  275.                         )
  276.                     )
  277.                     (run ("echo \"\" >\"%s\"" ratesfile))
  278.                     (if (<> 0 (BITAND ratechoice 1))
  279.                         (run ("type %s >>\"%s\"" "Config/Rates.config.belgium" ratesfile))
  280.                     )
  281.                     (if (<> 0 (BITAND ratechoice 2))
  282.                         (run ("type %s >>\"%s\"" "Config/Rates.config.deutschland" ratesfile))
  283.                     )
  284.                     (if (<> 0 (BITAND ratechoice 4))
  285.                         (run ("type %s >>\"%s\"" "Config/Rates.config.france" ratesfile))
  286.                     )
  287.                     (if (<> 0 (BITAND ratechoice 8))
  288.                         (run ("type %s >>\"%s\"" "Config/Rates.config.italy" ratesfile))
  289.                     )
  290.                     (if (<> 0 (BITAND ratechoice 16))
  291.                         (run ("type %s >>\"%s\"" "Config/Rates.config.nederland" ratesfile))
  292.                     )
  293.                     (if (<> 0 (BITAND ratechoice 32))
  294.                         (run ("type %s >>\"%s\"" "Config/Rates.config.norge" ratesfile))
  295.                     )
  296.                     (if (<> 0 (BITAND ratechoice 64))
  297.                         (run ("type %s >>\"%s\"" "Config/Rates.config.sverige" ratesfile))
  298.                     )
  299.                 )
  300.             )
  301.         )
  302.     )
  303. )
  304.  
  305. (copyfiles
  306.     (help @copyfiles-help)
  307.     (source "Config/Scanner.config")
  308.     (dest configdir)
  309.     (prompt "Installing scanners (\"Scanner.config\")")
  310.     (confirm)
  311. )
  312.  
  313.  
  314.  
  315. ;**
  316. ;**  Catalog files
  317. ;**
  318.  
  319. (complete 95)
  320.  
  321. (copyfiles
  322.     (help @copyfiles-help)
  323.     (prompt "Installing catalog files")
  324.     (source "Catalogs")
  325.     (dest catalogdir)
  326.     (all)
  327.     (confirm)
  328. )
  329.  
  330. (complete 99)
  331. (if (exists (tackon docdir "Register.Australia"))
  332.     (delete (tackon docdir "Register.Australia")
  333.         (help @delete-help)
  334.         (infos)
  335.         (prompt (cat "Continental Drift, the Australian registration "
  336.              "is closing down. You can no longer register "
  337.              "there. The Australian registration form will be "
  338.              "deleted."))
  339.         (confirm))
  340. )
  341. (complete 100)
  342.  
  343. (exit)
  344.  
  345.